import request from "@/utils/request";
import type { GetRoleListRes, AddRoleList } from "./model/roleModel";

enum Api {
  getRoleUrl = "/admin/acl/role",
  addRoleListUrl = "/admin/acl/role/save",
}

export const getRoleApi = (page: number, limit: number) => {
  return request.get<any, GetRoleListRes>(Api.getRoleUrl + `/${page}/${limit}`);
};

export const addRoleListApi = (data: AddRoleList) => {
  return request.post<any, null>(Api.addRoleListUrl, data);
};
